<?php
namespace app\index\controller;
use think\Request;
/**
* 项目控制器
*/
class Projects extends Base
{
	protected $model;
	public function __construct()
	{
		parent::__construct();
		$this->model = model('Projects');
		$this->projects_port_model = model('ProjectsPort');
	}
	/**
	 * 新建项目
	 */
	public function add()
	{
		return view('newProject');
	}

	/**
	 * 扫描设置
	 * @return [type] [description]
	 */
	public function scanSetting()
	{	
		$post = input('post.');
		if (empty($post)) {
			$this->error('');
		}
		/*$file = input('file.');
		dump($file);
		dump($post);die;*/
		$id = $this->model->addData($post) or $this->error($this->model->getError());
		$this->assign('id', $id);
		return view('projectSecond');
	}

	/**
	 * 事件设置
	 * @return [type] [description]
	 */
	public function eventSetting()
	{
		$post = input('post.');
		if (empty($post)) {
			$this->error('');
		}
		// $this->projects_port_model->addData();
		$id = $this->model->addData($post);
		$this->assign('id',$id);
		return view('projectThird');
	}
	/**
	 * 执行扫描
	 * @return [type] [description]
	 */
	public function scan()
	{
		$post = input('post.');
		if (empty($post)) {
			$this->error('');
		}
		$id = $this->model->addData($post);
		$this->success('开始扫描', 'Scan/scanState');
		// return view('projectThird');
	}
}